package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SetMealDishMapper {
    /**
     * 根据dish_id查找setmeal_id
     */
    List<Long> getSetMealIdByDishId(List<Long> dishIds);


    /**
     * 批量插入数据进入套餐菜品表
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 根据套餐id删除套餐菜品关系数据
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deleteBySetmealId(Long id);

    /**
     * 根据套餐id查询套餐菜品关系数据
     */
    List<SetmealDish> getSetmealDishBySetmealId(Long id);
}
